'use strict'

module.exports = {
	up: async (queryInterface, Sequelize) => {
		const { INTEGER, DATE, STRING } = Sequelize
		await queryInterface.createTable('user_infos', {
			id: { type: INTEGER, primaryKey: true, autoIncrement: true },
			user_id: INTEGER,
			_name: STRING,
			_avatar: STRING,
			_mobile: {
				type: STRING(11),
				unique: true,
			},
			_role: {
				type: INTEGER,
				defaultValue: 2,
			},
			provice_id: INTEGER,
			city_id: INTEGER,
			area_id: INTEGER,
			created_at: DATE,
			updated_at: DATE,
		})
	},
	down: async queryInterface => {
		await queryInterface.dropTable('user_infos')
	},
}
